<!DOCTYPE html>
<html>
<head>
    

    

    



    <meta charset="utf-8">
    
    
    
    
    <title>cesium| Primitive图元自定义着色器(1) | 一只咸鱼 | 努力学习最新姿势！！！</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#3F51B5">
    
    
    <meta name="keywords" content="Cesium">
    <meta name="description" content="前言Primitive是cesium核心api之一，与entity方式绘制方式(基于数据)不同，primitive更接近渲染引擎底层。entity适合以数据绘制实体，而primitive更适合图形学对有webgl经验的更亲和。primitive绘制的图形比entity添加的实体性能更好，webgl特性使primitive能绘制更多样式的图形。 对entity和primitive与scene之间的关">
<meta property="og:type" content="article">
<meta property="og:title" content="cesium| Primitive图元自定义着色器(1)">
<meta property="og:url" content="http://yoursite.com/2020/04/10/cesium-primitive%E5%9B%BE%E5%85%83%E8%87%AA%E5%AE%9A%E4%B9%89%E7%9D%80%E8%89%B2%E5%99%A8/index.html">
<meta property="og:site_name" content="一只咸鱼">
<meta property="og:description" content="前言Primitive是cesium核心api之一，与entity方式绘制方式(基于数据)不同，primitive更接近渲染引擎底层。entity适合以数据绘制实体，而primitive更适合图形学对有webgl经验的更亲和。primitive绘制的图形比entity添加的实体性能更好，webgl特性使primitive能绘制更多样式的图形。 对entity和primitive与scene之间的关">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20200527163017621.gif">
<meta property="article:published_time" content="2020-04-10T07:21:00.000Z">
<meta property="article:modified_time" content="2020-05-28T03:57:26.317Z">
<meta property="article:author" content="Mr.Zhang">
<meta property="article:tag" content="Cesium">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://img-blog.csdnimg.cn/20200527163017621.gif">
    
        <link rel="alternate" type="application/atom+xml" title="一只咸鱼" href="/atom.xml">
    
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" href="//unpkg.com/hexo-theme-material-indigo@latest/css/style.css">
    <script>window.lazyScripts=[]</script>

    <!-- custom head -->
    

<meta name="generator" content="Hexo 4.2.0"></head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/brand.jpg)">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">Mr.Zhang</h5>
          <a href="mailto:zhangticcc@163.com" title="zhangticcc@163.com" class="mail">zhangticcc@163.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                首页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                时间轴
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                标签
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/categories"  >
                <i class="icon icon-lg icon-th-list"></i>
                分类
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://weibo.com/u/5392412243" target="_blank" >
                <i class="icon icon-lg icon-weibo"></i>
                微博
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://github.com/zhangti0708" target="_blank" >
                <i class="icon icon-lg icon-github"></i>
                开源地址
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://blog.csdn.net/weixin_40902527" target="_blank" >
                <i class="icon icon-lg icon-rss"></i>
                技术博客
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="http://zhangticcc.gitee.io/webgis/" target="_blank" >
                <i class="icon icon-lg icon-globe"></i>
                GIS案例
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://mp.weixin.qq.com/s/p4TOhKcr4RZkZWzuMYyBEQ" target="_blank" >
                <i class="icon icon-lg icon-weixin"></i>
                微信订阅号
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">cesium| Primitive图元自定义着色器(1)</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">cesium| Primitive图元自定义着色器(1)</h1>
        <h5 class="subtitle">
            
                <time datetime="2020-04-10T07:21:00.000Z" itemprop="datePublished" class="page-time">
  2020-04-10
</time>


	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/GIS/">GIS</a></li></ul>

            
        </h5>
    </div>

    


</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap post-toc-shrink" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#前言"><span class="post-toc-number">1.</span> <span class="post-toc-text">前言</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#Primitive"><span class="post-toc-number">1.1.</span> <span class="post-toc-text">Primitive</span></a></li></ol></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#示例"><span class="post-toc-number">2.</span> <span class="post-toc-text">示例</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#数据准备"><span class="post-toc-number">2.0.1.</span> <span class="post-toc-text">数据准备</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#Geometry"><span class="post-toc-number">2.0.2.</span> <span class="post-toc-text">Geometry</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#shader着色器"><span class="post-toc-number">2.0.3.</span> <span class="post-toc-text">shader着色器</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#appearance"><span class="post-toc-number">2.0.4.</span> <span class="post-toc-text">appearance</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#创建Primitive"><span class="post-toc-number">2.0.5.</span> <span class="post-toc-text">创建Primitive</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#效果"><span class="post-toc-number">2.0.6.</span> <span class="post-toc-text">效果</span></a></li></ol></li></ol></li></ol>
        </nav>
    </aside>


<article id="post-cesium-primitive图元自定义着色器"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">cesium| Primitive图元自定义着色器(1)</h1>
        <div class="post-meta">
            <time class="post-time" title="2020-04-10 15:21:00" datetime="2020-04-10T07:21:00.000Z"  itemprop="datePublished">2020-04-10</time>

            
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/GIS/">GIS</a></li></ul>



            
<span id="busuanzi_container_page_pv" title="文章总阅读量" style='display:none'>
    <i class="icon icon-eye icon-pr"></i><span id="busuanzi_value_page_pv"></span>
</span>


        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <h3 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h3><p><code>Primitive是cesium核心api之一，与entity方式绘制方式(基于数据)不同，primitive更接近渲染引擎底层。entity适合以数据绘制实体，而primitive更适合图形学对有webgl经验的更亲和。primitive绘制的图形比entity添加的实体性能更好，webgl特性使primitive能绘制更多样式的图形。</code></p>
<p>对entity和primitive与scene之间的关联可以参考 【cesiumAPI笔记篇】</p>
<h4 id="Primitive"><a href="#Primitive" class="headerlink" title="Primitive"></a>Primitive</h4><p>特性</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">1 由两部分组成</span><br><span class="line">（1）几何形状（Geometry）：定义了Primitive的结构，例如三角形、线条、点等</span><br><span class="line">（2）外观（Appearance ）：定义Primitive的着色（Sharding），包括GLSL（OpenGL着色语言，OpenGL ShadingLanguage）顶点着色器和片段着色器（ vertex and fragment shaders），以及渲染状态（render state）</span><br><span class="line"></span><br><span class="line">2 使用Geometry和Appearance 具有以下优势：</span><br><span class="line">（1）性能：绘制大量Primitive时，可以将其合并为单个Geometry以减轻CPU负担、更好的使用GPU。合并Primitive由web worker线程执行，UI保持响应性</span><br><span class="line">（2）灵活性：Geometry与Appearance 解耦，两者可以分别进行修改</span><br><span class="line">（3）低级别访问：易于编写GLSL 顶点、片段着色器、使用自定义的渲染状态</span><br><span class="line"></span><br><span class="line">3 同时具有以下劣势：</span><br><span class="line">（1）需要编写更多地代码</span><br><span class="line">（2）需要对图形编程有更多的理解，特别是OpenGL的知识</span><br></pre></td></tr></table></figure>

<p>Primitive详解 ：<code>https://www.jianshu.com/p/5a74c607a591</code></p>
<h3 id="示例"><a href="#示例" class="headerlink" title="示例"></a>示例</h3><h5 id="数据准备"><a href="#数据准备" class="headerlink" title="数据准备"></a>数据准备</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&#x2F;&#x2F;雷达的高度</span><br><span class="line">var length &#x3D; 400000.0;</span><br><span class="line">&#x2F;&#x2F;地面位置(垂直地面)</span><br><span class="line"> var positionOnEllipsoid &#x3D; Cesium.Cartesian3.fromDegrees(116.39, 39.9);</span><br><span class="line">&#x2F;&#x2F;中心位置</span><br><span class="line">var centerOnEllipsoid &#x3D; Cesium.Cartesian3.fromDegrees(116.39, 39.9, length*0.5);</span><br><span class="line">&#x2F;&#x2F; 顶部位置(卫星位置)</span><br><span class="line">var topOnEllipsoid &#x3D; Cesium.Cartesian3.fromDegrees(116.39, 39.9,length);</span><br><span class="line">&#x2F;&#x2F;矩阵计算</span><br><span class="line">var modelMatrix &#x3D; Cesium.Matrix4.multiplyByTranslation( &#x2F;&#x2F;转换矩阵</span><br><span class="line">    Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid), &#x2F;&#x2F;矩阵</span><br><span class="line">    new Cesium.Cartesian3(0.0, 0.0, length * 0.5), &#x2F;&#x2F;要转换的笛卡尔坐标 </span><br><span class="line">    new Cesium.Matrix4() &#x2F;&#x2F;返回新的矩阵</span><br><span class="line"> );</span><br></pre></td></tr></table></figure>

<h5 id="Geometry"><a href="#Geometry" class="headerlink" title="Geometry"></a>Geometry</h5><p>创建一个圆锥几何图形</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">1. 构造geometry</span><br><span class="line">var cylinderGeometry &#x3D; new Cesium.CylinderGeometry(&#123;</span><br><span class="line">    length: length,</span><br><span class="line">    topRadius: 0.0,</span><br><span class="line">    bottomRadius: length * 0.5,</span><br><span class="line">    vertexFormat: Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat&#125;);</span><br><span class="line">2. 创建GeometryInstance</span><br><span class="line">var redCone &#x3D; new Cesium.GeometryInstance(&#123;</span><br><span class="line">    geometry: cylinderGeometry, &#x2F;&#x2F;geomtry类型</span><br><span class="line">    modelMatrix: modelMatrix, &#x2F;&#x2F;模型矩阵 调整矩阵的位置和方向</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure>

<h5 id="shader着色器"><a href="#shader着色器" class="headerlink" title="shader着色器"></a>shader着色器</h5><p>定义glsl代码</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">let source &#x3D;</span><br><span class="line">&#x2F;&#x2F;传入的动态数值</span><br><span class="line">&#96;uniform vec4 color; </span><br><span class="line"> uniform float repeat; </span><br><span class="line"> uniform float offset; </span><br><span class="line"> uniform float thickness;</span><br><span class="line"></span><br><span class="line">&#x2F;&#x2F;设置图形外观材质</span><br><span class="line">czm_material czm_getMaterial(czm_materialInput materialInput)&#123;</span><br><span class="line">    czm_material material &#x3D; czm_getDefaultMaterial(materialInput); &#x2F;&#x2F;获取内置的默认材质</span><br><span class="line">    float sp &#x3D; 1.0&#x2F;repeat; &#x2F;&#x2F;重复贴图</span><br><span class="line">    vec2 st &#x3D; materialInput.st; &#x2F;&#x2F;二维纹理坐标</span><br><span class="line">    float dis &#x3D; distance(st, vec2(0.5)); &#x2F;&#x2F;计算距离</span><br><span class="line">    float m &#x3D; mod(dis + offset, sp); &#x2F;&#x2F;间隔</span><br><span class="line">    float a &#x3D; step(sp*(1.0-thickness), m);&#x2F;&#x2F;线条拼色 </span><br><span class="line">	&#x2F;&#x2F;修改材质</span><br><span class="line">    material.diffuse &#x3D; color.rgb;</span><br><span class="line">    material.alpha &#x3D; a * color.a;</span><br><span class="line">	return material;</span><br><span class="line">&#125;&#96;</span><br></pre></td></tr></table></figure>

<p>自定义shader着色器 和 Material ：<code>https://www.cnblogs.com/fuckgiser/p/6171245.html</code></p>
<h5 id="appearance"><a href="#appearance" class="headerlink" title="appearance"></a>appearance</h5><p>自定义material外观材质，修改着色器</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">let material &#x3D; new Cesium.Material(&#123;</span><br><span class="line">	fabric: &#123;</span><br><span class="line">         type: &#39;VtxfShader1&#39;,</span><br><span class="line">         uniforms: &#123; &#x2F;&#x2F;动态传递参数</span><br><span class="line">              color: new Cesium.Color(0.2, 1.0, 0.0, 1.0),</span><br><span class="line">              repeat: 30.0,</span><br><span class="line">              offset: 0.0,</span><br><span class="line">              thickness: 0.3,</span><br><span class="line">         &#125;,</span><br><span class="line">         source ：source</span><br><span class="line">     &#125;,</span><br><span class="line">     translucent: false</span><br><span class="line">&#125;)</span><br></pre></td></tr></table></figure>

<p>定义appearance外观</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">let appearance &#x3D; new Cesium.MaterialAppearance(&#123;</span><br><span class="line">	material：material，&#x2F;&#x2F;自定义的材质</span><br><span class="line">    faceForward : false, &#x2F;&#x2F; 当绘制的三角面片法向不能朝向视点时，自动翻转法向，					从而避免法向计算后发黑等问题</span><br><span class="line">    closed: true &#x2F;&#x2F; 是否为封闭体，实际上执行的是是否进行背面裁剪</span><br><span class="line">&#125;)</span><br></pre></td></tr></table></figure>

<h5 id="创建Primitive"><a href="#创建Primitive" class="headerlink" title="创建Primitive"></a>创建Primitive</h5><p>创建自定义primitive图元，实现动态效果</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">&#x2F;&#x2F;添加Primitive</span><br><span class="line"> var radar &#x3D; viewer.scene.primitives.add(</span><br><span class="line">  new Cesium.Primitive(&#123;</span><br><span class="line">     geometryInstances: [redCone],</span><br><span class="line">     appearance：appearance</span><br><span class="line"> &#125;));</span><br><span class="line"> </span><br><span class="line"> &#x2F;&#x2F;动态修改雷达材质中的offset变量，从而实现动态效果。</span><br><span class="line"> viewer.scene.preUpdate.addEventListener(function() &#123;</span><br><span class="line">     var offset &#x3D; radar.appearance.material.uniforms.offset;</span><br><span class="line">         offset -&#x3D; 0.001;</span><br><span class="line">         if (offset &gt; 1.0) &#123;</span><br><span class="line">             offset &#x3D; 0.0;</span><br><span class="line">         &#125;</span><br><span class="line">     radar.appearance.material.uniforms.offset &#x3D; offset;</span><br><span class="line"> &#125;)</span><br></pre></td></tr></table></figure>

<h5 id="效果"><a href="#效果" class="headerlink" title="效果"></a>效果</h5><img alt="" height="475" src="https://img-blog.csdnimg.cn/20200527163017621.gif" width="700">
        </div>

        <blockquote class="post-copyright">
    
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2020-05-28T03:57:26.317Z" itemprop="dateUpdated">2020-05-28 11:57:26</time>
</span><br>


        
        这里可以写作者留言，标签和 hexo 中所有变量及辅助函数等均可调用，示例：<a href="/2020/04/10/cesium-primitive%E5%9B%BE%E5%85%83%E8%87%AA%E5%AE%9A%E4%B9%89%E7%9D%80%E8%89%B2%E5%99%A8/" target="_blank" rel="external">http://yoursite.com/2020/04/10/cesium-primitive%E5%9B%BE%E5%85%83%E8%87%AA%E5%AE%9A%E4%B9%89%E7%9D%80%E8%89%B2%E5%99%A8/</a>
        
    </div>
    
    <footer>
        <a href="http://yoursite.com">
            <img src="/img/avatar.jpg" alt="Mr.Zhang">
            Mr.Zhang
        </a>
    </footer>
</blockquote>

        
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;" class="page-reward-btn waves-effect waves-circle waves-light">赏</a>
</div>



        <div class="post-footer">
            
	<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Cesium/" rel="tag">Cesium</a></li></ul>


            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://yoursite.com/2020/04/10/cesium-primitive%E5%9B%BE%E5%85%83%E8%87%AA%E5%AE%9A%E4%B9%89%E7%9D%80%E8%89%B2%E5%99%A8/&title=《cesium| Primitive图元自定义着色器(1)》 — 一只咸鱼&pic=http://yoursite.com/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://yoursite.com/2020/04/10/cesium-primitive%E5%9B%BE%E5%85%83%E8%87%AA%E5%AE%9A%E4%B9%89%E7%9D%80%E8%89%B2%E5%99%A8/&title=《cesium| Primitive图元自定义着色器(1)》 — 一只咸鱼&source=分享各种福利和姿势..." data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://yoursite.com/2020/04/10/cesium-primitive%E5%9B%BE%E5%85%83%E8%87%AA%E5%AE%9A%E4%B9%89%E7%9D%80%E8%89%B2%E5%99%A8/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《cesium| Primitive图元自定义着色器(1)》 — 一只咸鱼&url=http://yoursite.com/2020/04/10/cesium-primitive%E5%9B%BE%E5%85%83%E8%87%AA%E5%AE%9A%E4%B9%89%E7%9D%80%E8%89%B2%E5%99%A8/&via=http://yoursite.com" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://yoursite.com/2020/04/10/cesium-primitive%E5%9B%BE%E5%85%83%E8%87%AA%E5%AE%9A%E4%B9%89%E7%9D%80%E8%89%B2%E5%99%A8/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/2020/04/10/cesium-postProcessStages%E5%90%8E%E6%9C%9F%E5%A4%84%E7%90%86%E6%B7%BB%E5%8A%A0%E7%89%B9%E6%95%88/" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
        <h4 class="title">cesium| PostProcessStage后期处理</h4>
      </a>
    </div>
  

  
    <div class="waves-block waves-effect next">
      <a href="/2020/04/10/%E9%9A%8F%E7%AC%94-cesium%E5%AE%9E%E4%BD%93%E5%8A%A8%E6%80%81%E6%95%88%E6%9E%9C%E5%AE%9E%E7%8E%B0/" id="post-next" class="post-nav-link">
        <div class="tips">Next <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
        <h4 class="title">随笔|cesium的Entity动态效果实现</h4>
      </a>
    </div>
  
</nav>



    




















</article>

<div id="reward" class="page-modal reward-lay">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <h3 class="reward-title">
        <i class="icon icon-quote-left"></i>
        谢谢大爷~
        <i class="icon icon-quote-right"></i>
    </h3>
    <div class="reward-content">
        
        <div class="reward-code">
            <img id="rewardCode" src="/img/wechat.jpg" alt="打赏二维码">
        </div>
        
        <label class="reward-toggle">
            <input id="rewardToggle" type="checkbox" class="reward-toggle-check"
                data-wechat="/img/wechat.jpg" data-alipay="/img/alipay.jpg">
            <div class="reward-toggle-ctrol">
                <span class="reward-toggle-item wechat">微信</span>
                <span class="reward-toggle-label"></span>
                <span class="reward-toggle-item alipay">支付宝</span>
            </div>
        </label>
        
    </div>
</div>



</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        站点总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        站点总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


        <p>
            
                <span><a href="/atom.xml" target="_blank" class="rss" title="rss"><i class="icon icon-lg icon-rss"></i></a></span>
            
            <span>博客内容遵循 <a rel="license noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" target="_blank">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a></span>
        </p>
    </div>
    <div class="bottom">
        <p><span>Mr.Zhang &copy; 2015 - 2020</span>
            <span>
                
                Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a>
            </span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://yoursite.com/2020/04/10/cesium-primitive%E5%9B%BE%E5%85%83%E8%87%AA%E5%AE%9A%E4%B9%89%E7%9D%80%E8%89%B2%E5%99%A8/&title=《cesium| Primitive图元自定义着色器(1)》 — 一只咸鱼&pic=http://yoursite.com/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://yoursite.com/2020/04/10/cesium-primitive%E5%9B%BE%E5%85%83%E8%87%AA%E5%AE%9A%E4%B9%89%E7%9D%80%E8%89%B2%E5%99%A8/&title=《cesium| Primitive图元自定义着色器(1)》 — 一只咸鱼&source=分享各种福利和姿势..." data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://yoursite.com/2020/04/10/cesium-primitive%E5%9B%BE%E5%85%83%E8%87%AA%E5%AE%9A%E4%B9%89%E7%9D%80%E8%89%B2%E5%99%A8/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《cesium| Primitive图元自定义着色器(1)》 — 一只咸鱼&url=http://yoursite.com/2020/04/10/cesium-primitive%E5%9B%BE%E5%85%83%E8%87%AA%E5%AE%9A%E4%B9%89%E7%9D%80%E8%89%B2%E5%99%A8/&via=http://yoursite.com" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://yoursite.com/2020/04/10/cesium-primitive%E5%9B%BE%E5%85%83%E8%87%AA%E5%AE%9A%E4%B9%89%E7%9D%80%E8%89%B2%E5%99%A8/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="//api.qrserver.com/v1/create-qr-code/?data=http://yoursite.com/2020/04/10/cesium-primitive%E5%9B%BE%E5%85%83%E8%87%AA%E5%AE%9A%E4%B9%89%E7%9D%80%E8%89%B2%E5%99%A8/" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: true };


</script>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/main.min.js"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/search.min.js" async></script>






<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>



<script>
(function() {
    var OriginTitile = document.title, titleTime;
    document.addEventListener('visibilitychange', function() {
        if (document.hidden) {
            document.title = '死鬼去哪里了！';
            clearTimeout(titleTime);
        } else {
            document.title = '(つェ⊂)咦!又好了!';
            titleTime = setTimeout(function() {
                document.title = OriginTitile;
            },2000);
        }
    });
})();
</script>



</body>
</html>
